package com.enation.app.javashop.api.client;

import com.enation.app.javashop.model.system.dos.LogisticsCompanyDO;
import com.enation.app.javashop.service.system.LogisticsCompanyManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @author fk
 * @version v2.0
 * @Description: 物流公司
 * @date 2018/8/9 16:58
 * @since v7.0.0
 */
@RestController
@RequestMapping("/client/logi-company")
@Validated
@ApiIgnore
public class LogiCompanyClientController {

    @Autowired
    private LogisticsCompanyManager logisticsCompanyManager;

    @GetMapping("/code")
    public LogisticsCompanyDO getLogiByCode(@RequestParam("code") String code) {

        return logisticsCompanyManager.getLogiByCode(code);
    }

    @GetMapping("/{id}")
    public LogisticsCompanyDO getModel(@PathVariable("id") Long id) {

        return logisticsCompanyManager.getModel(id);
    }

    @GetMapping
    public List<LogisticsCompanyDO> list() {

        return logisticsCompanyManager.list();
    }

    @RequestMapping(value = "/normal",method = RequestMethod.GET)
    public List<LogisticsCompanyDO> listAllNormal(){

        return logisticsCompanyManager.listAllNormal();
    }

}
